php forum
php mysql forum
php mysql smarty
 
Topic Options
#317296 - 06/26/08 04:01 AM [7.3.x] Scheduled board close for backup
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
I have a cronjob running that backup's my ubb database and directory. Since it's better to have the board closed while making a backup, I have added a scheduled close for ubb.

open /languages/english/generic.php

Find:
Php Code:
$ubbt_lang['COPY2CLIP'] = 'Copy'; 


Add below:
Php Code:
$ubbt_lang['BACKUPCLOSED'] = 'Because of a scheduled backup the board is closed from %s until %s'; 


Repeat editing the generic.php for every other language you have.

open /ubbthreads.php
Find:
Php Code:

		$user['USER_STYLE'] = $force ? 0 : $user['USER_STYLE'];
		$html->set_style($force);
 


Add below:
Php Code:

		// closed for backup?
		$backupstarttime = "04:30";
		$backupstoptime = "04:45";
		
		$backuptime = date("H:i");
		if ($backuptime >= $backupstarttime && $backuptime < $backupstoptime) {
			$insert = $ubbt_lang['BACKUPCLOSED'];
			$closed = true;
			$fatal_error = true;
			$fatal_error_message = sprintf($insert,$backupstarttime,$backupstoptime);
		}
		
		// end closed for backup
 


Save, upload, and voila! Board is closed between 04:30 and 04:45.

Adjusting $backupstarttime and $backupstoptime will adjust the times the board will automaticly close.

It will also close the board for admins. The purpose of the close is to make the best database snapshop possible, so you don't want yourself messing around the forum also.

How to backup your forum? Lost of information about the subject on ubbcentral.
_________________________

Top
#317297 - 06/26/08 09:10 AM Re: [7.3.x] Scheduled board close for backup [Re: blaaskaak]
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
'repeat this for every other language file you have' ??

i assume you mean for each distinct language, modify generic.php.. no?

:shrug:
_________________________

Top
#317298 - 06/26/08 09:25 AM Re: [7.3.x] Scheduled board close for backup [Re: sirdude]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Originally Posted By: sirdude
i assume you mean for each distinct language, modify generic.php.. no?


Yeppers smile
_________________________

Top
#317335 - 06/30/08 12:51 PM Re: [7.3.x] Scheduled board close for backup [Re: blaaskaak]
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
Thanks Yarp!
_________________________
- Allen wavey
- What Drives You?

Top



Moderator:  sirdude 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks